package com.xiangshizhineng.tianzhangzhi.app.dao;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xiangshizhineng.tianzhangzhi.app.model.dto.UserDTO;
import com.xiangshizhineng.tianzhangzhi.app.model.entity.User;
import com.xiangshizhineng.tianzhangzhi.app.model.response.DistrictResponse;
import com.xiangshizhineng.tianzhangzhi.app.model.response.UserResponse;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Component
public interface UserDAO extends BaseMapper<UserResponse> {
    UserResponse findUserById(@Param("id") Long id);
    List<UserResponse> tbSuperior(@Param("code")String code, @Param("tzjb")String tzjb);

    @Select("select tzxm, case tzjb when '3' then '三级田长' when '4' then '网格员' end tzjb from tz_user ${ew.customSqlSegment}")
    List<UserResponse> selectTZ(@Param(Constants.WRAPPER) Wrapper<UserResponse> wrapper);
}
